
		app=angular.module('myApp',['ngRoute'])
		app.config(function($routeProvider){
			$routeProvider.when('/a',{
				templateUrl:"sy.html",
				//controller:"mk"
			}).when('/b',{
				templateUrl:"gwc.html",
				///controller:"mkkq"
			}).otherwise({redirectTo:"/a"})
		})
		app.controller('mk',['$scope','$http',function ($scope,$http) {
			
			$http.get('./data/index.json').then(function(res){
				$scope.data=res.data.info;
			})
			$scope.arr=[];
			$scope.sl=0;
			$scope.sum=0;
			$scope.dj=function($index){
				//首页里面的数量
				 $scope.sl++;
				 
				 $scope.data[$index].fs++;
				//console.log($scope.sl);
				$scope.sum += $scope.data[$index].money;
				 //console.log($scope.sum)
				 $scope.arr.push($scope.data[$index]);
				 
				// $scope.newArr=[];
				 for(var i = 0; i < $scope.arr.length; i++) {
					console.log($scope.arr.length)
					for(var j = i + 1; j < $scope.arr.length; j++) {
						if($scope.arr[i] == $scope.arr[j]) {
							$scope.arr.splice(i, 1);
							j--;
						}
					}
//					if ( $scope.newArr.indexOf($scope.arr[i]) == -1) {
//						$scope.newArr.push($scope.arr[i])
//					}
				}
				 
				 
				 
			}
            
            
            
            $scope.qk=function(){
            	$scope.sl=0;
            	$scope.sum=0;
            	$scope.arr=[];
            	
            	angular.forEach($scope.data,function(val,key){
            		val.fs=0;
            		
            	})
            }
         }])
